using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

/// <summary>
/// Summary description for ManagePatron
/// </summary>
public class ManagePatron
{
    //Enter new patron
    public void enterNewPatron(string firstName, string lastName, string address, string city,
                               string State, int zip, string phoneNumber, string email,
                               Boolean wantNewsLetter, int libraryId, Boolean isAdult,
                               Boolean wantsNotifications, string PreferredContactMethod,
                               DateTime CardExpires, string Password)
    {
        DatabaseAccess accessor = new DatabaseAccess();
        accessor.addPatron(firstName, lastName, address, city, State, zip, phoneNumber, email,
                           wantNewsLetter, libraryId, isAdult, wantsNotifications, PreferredContactMethod,
                           CardExpires, Password);
    }

    //Update Patron
    public void updatePatron(string firstName, string lastName, string address, string city,
                               string State, int zip, string phoneNumber, string email,
                               Boolean wantNewsLetter, int libraryId, Boolean isAdult,
                               Boolean wantsNotifications, string PreferredContactMethod,
                               DateTime CardExpires, string Password)
    {
        DatabaseAccess accessor = new DatabaseAccess();
        accessor.UpdatePatron(firstName, lastName, address, city, State, zip, phoneNumber, email,
                           wantNewsLetter, libraryId, isAdult, wantsNotifications, PreferredContactMethod,
                           CardExpires, Password);
    }
    public void deletePatron() { }

    public Patron getPatron(int PersonID)
    {
        DatabaseAccess da = new DatabaseAccess();
        return da.getPatronInfo(PersonID);
    }

    

    public SqlDataReader getAllPatrons()
    {
        return null;
    }
    public SqlDataReader findPatron(String Lastname)
    {
        return null;
    }

    public int login(int PersonID, String Password) 
    {
        DatabaseAccess da = new DatabaseAccess();
        return da.getPatronLogin(PersonID, Password);
    }

    public SqlDataAdapter getPatronAcct(int personID)
    {
        DatabaseAccess da = new DatabaseAccess();
        return da.getPatronAcct(personID);
    }

    //Jacquie - get patron fines
    public float getPatronFines_LibrarianView(int personId)
    {
        DatabaseAccess da = new DatabaseAccess();
        return da.getFines_LibrarianView(personId);
    }

}
